function Player(id, name) {
    this.id = id;
    this.name = name;
}
Player.prototype = {
    constructor: Player,
    id: -1,
    name: null,
}

var playerMgr = {};
playerMgr.players = new Array();
window.playerMgr = playerMgr;

playerMgr.add = function (id) {
    var contains = false;
    for (var i = 0; i < playerMgr.players.length; i++) {
        var p = playerMgr.players[i];
        if (p.id == id) {
            contains = true;
            break;
        }
    }
    if (contains == false) {
        var player = new Player(id, id);
        playerMgr.players.push(player);
    }
}

playerMgr.remove = function (id) {
    for (var player of playerMgr.players) {
        if (player.id == id) {
            playerMgr.players.pop(player);
        }
    }
}